home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 19 / CU Amiga Magazine's Super CD-ROM 19 (1998)(EMAP Images)(GB)[!][issue 1998-02].iso / CUCD / Readers / Gui4Cli / Gui4Cli.gc < prev    next >
Text File  |  1997-12-02  |  12KB  |  514 lines

  1. G4C
  2.  
  3. ; $VER: Gui4Cli.gc 3.2 
  4. ; =================================================================
  5. ; This is the gui which is opened when you click the "Prefs" button 
  6. ; on the Gui4Cli requester. 
  7.  
  8. ; If you find yourself feeling queezy after having suffered the full
  9. ; effect of it's poping open at you unwarned, you may change it as 
  10. ; you see fit..
  11.  
  12.  
  13. WINBIG 179 24 299 201 "Gui4Cli"
  14. WinType 11110001
  15.  
  16. BOX 0 0 297 201 out button
  17. ;* ICON 244 11 "guis:gui4cli"
  18.  
  19. ; -----------------------------------------------------------------
  20. ;               System events
  21. ; -----------------------------------------------------------------
  22.  
  23. xOnLoad
  24. setgadvalues gui4cli.gc         ; set default values
  25. setgad gui4cli.gc 72 off
  26. mode = GUI
  27. lvhelp = 'Choose guis to load'
  28. oldguidir = GUIs:
  29. update gui4cli.gc 50 'Port: $$g4c.port'
  30. gosub gui4cli.gc guichange
  31. guiopen Gui4Cli.gc
  32.  
  33. xonreload
  34. guiopen Gui4Cli.gc
  35. guiscreen gui4cli.gc front
  36.  
  37. xOnOpen
  38. SetGad Gui4Cli.gc 1 OFF         ; remove the appicon
  39. lvuse Gui4Cli.gc 10             ; & refresh the listview
  40. lvdir refresh
  41.  
  42. xOnClose 
  43. SetGad Gui4Cli.gc 1 ON          ; open the appicon
  44.  
  45. xOnFail
  46. ezreq "Failed.." OK ""
  47.  
  48. xAppIcon 0 0 GUIs:Gui4Cli "Gui4Cli" apivar OFF
  49. GadID 1
  50. GuiOpen Gui4Cli.gc
  51. GuiScreen Gui4Cli.gc FRONT
  52. if $apivar > ' '
  53. andifexists DIRECTORY $apivar   ; if a directory or volume icon was
  54. orifexists DOS $apivar          ; dropped on the icon,
  55.     lvuse Gui4Cli.gc 10         ; we cd to it.. 
  56.     lvdir #$apivar
  57. endif
  58.  
  59. ; -----------------------------------------------------------------
  60. ;               Main mode CYCLER
  61. ;               - will rotate gui through all modes
  62. ; -----------------------------------------------------------------
  63.  
  64. XCYCLER 6 4 120 15 '' mode
  65. gadid 900
  66. gadhelp 'Will cycle the gui through its modes'
  67. cstr 'GUI Control' GUI
  68. cstr 'GUI Load'    LOAD
  69. cstr 'Settings'    SET
  70. gosub gui4cli.gc guichange
  71.  
  72.  
  73. xroutine guichange
  74. docase $mode
  75.  case = GUI
  76.         setgad gui4cli.gc 10 HIDE       ; the listview
  77.         setgad gui4cli.gc 50/59 SHOW    ; other lv & Open/close/quit etc
  78.         setgad gui4cli.gc 60/100 HIDE
  79.         lvuse Gui4Cli.gc 54
  80.         lvdir #env:$$g4c.port
  81.         setwintitle gui4cli.gc 'Port $$g4c.port : Home        '
  82.         break
  83.  
  84.  case = LOAD
  85.         setgad gui4cli.gc 10 SHOW
  86.         setgad gui4cli.gc 50/58 HIDE
  87.         setgad gui4cli.gc 59 SHOW
  88.         setgad gui4cli.gc 60/79 SHOW
  89.         setgad gui4cli.gc 80/100 HIDE
  90.         lvhelp = 'Choose guis from here'
  91.         setwintitle gui4cli.gc '$oldguidir                            '
  92.         break
  93.  
  94.  case = SET
  95.         setgad gui4cli.gc 10 HIDE
  96.         setgad gui4cli.gc 50/79 HIDE
  97.         setgad gui4cli.gc 80/89 SHOW
  98.         setwintitle gui4cli.gc 'Gui4Cli settings'
  99.         break
  100.  
  101. endcase
  102. partredraw gui4cli.gc 4 20 291 178
  103.  
  104.  
  105. ; -----------------------------------------------------------------
  106. ;               Listview for GUI mode
  107. ; -----------------------------------------------------------------
  108.  
  109. XLISTVIEW 6 66 285 132 "" guivar '' 0 DIR
  110. gadid 54
  111. gadfont #mono 8 000
  112. gadhelp 'These are the guis currently loaded'
  113. extract guivar file fname
  114. guiopen $fname
  115.  
  116. ; -----------------------------------------------------------------
  117. ;               GUI mode
  118. ;               will act on the selected listview items
  119. ; -----------------------------------------------------------------
  120.  
  121. TEXT 105 25 174 15 port 35 BOX
  122. gadid 50
  123.  
  124. XBUTTON 15 45 20 14 "R"         ; refresh list
  125. gadid 51
  126. gadhelp 'Refreshes the list of loaded guis'
  127. lvuse Gui4Cli.gc 54
  128. lvdir refresh
  129.  
  130. XBUTTON 40 45 58 14 Open    ; open
  131. gadid 51
  132. gadhelp 'Will open the selected guis'
  133. lvuse Gui4Cli.gc 54
  134. lvmulti first
  135. while $guivar > ''
  136.     extract guivar file fname
  137.     guiopen $fname
  138.     lvmulti next
  139. endwhile
  140. lvdir none
  141.  
  142. XBUTTON 100 45 58 14 Close   ; close
  143. gadid 52
  144. gadhelp 'Will close the selected guis'
  145. lvuse Gui4Cli.gc 54
  146. lvmulti first
  147. while $guivar > ''
  148.     extract guivar file fname
  149.     guiclose $fname
  150.     lvmulti next
  151. endwhile
  152. lvdir none
  153.  
  154. XBUTTON 160 45 58 14 Unload  ; unload
  155. gadid 53
  156. gadhelp 'Will quit the selected guis'
  157. lvuse Gui4Cli.gc 54
  158. lvmulti first
  159. while $guivar > ''
  160.     extract guivar file fname
  161.     guiquit $fname
  162.     lvmulti next
  163. endwhile
  164. ; the guis won't actually quit until all commands have executed, so..
  165. reflag = 1
  166.  
  167. xAfter
  168. if $reflag = 1
  169.    reflag = 0
  170.    lvdir refresh
  171. endif
  172.  
  173. XBUTTON 235 45 20 14 "A"  ; also shown in gui mode
  174. gadhelp 'Select all items'
  175. gadid 51
  176. lvuse Gui4Cli.gc 54
  177. lvdir all
  178.  
  179. XBUTTON 255 45 20 14 "N"
  180. gadhelp 'Unselect all items'
  181. gadid 51
  182. lvuse Gui4Cli.gc 54
  183. lvdir none
  184.  
  185. BOX 6 22 284 41 in button
  186. GADID 59
  187.  
  188. CTEXT 18 27 'GUI Control' #screen 8 2 0 0001
  189. gadid 50
  190.  
  191.  
  192. ; -----------------------------------------------------------------
  193. ;               Listview for LOAD/FAV mode
  194. ; -----------------------------------------------------------------
  195.  
  196. XLISTVIEW 6 66 285 132 "" guivar GUIs: 0 DIR
  197. gadid 10
  198. gadfont #mono 8 000
  199. gadhelp 'Listview : $lvhelp'    ; we set it above according to mode
  200. docase $mode
  201.   case = FAV
  202.         setgad gui4cli.gc 71 on         ; if double clicked in FAV mode
  203.         setgad gui4cli.gc 60/63 on      ; set it back to LOAD mode
  204.         setgad gui4cli.gc 72 off        ; and cd to selection
  205.         lvhelp = 'Choose guis to load'
  206.         lvmode DIR
  207.         lvdir #$guivar
  208.         mode = LOAD
  209.         break
  210.   case = LOAD
  211.         if $guivar H= G4C
  212.             guiload $guivar
  213.         endif
  214.         break
  215. endcase
  216.         
  217. xlvdirhook 10
  218. if $mode = LOAD
  219.     oldguidir = $$lv.dir
  220.     setwintitle gui4cli.gc '$oldguidir                         '
  221. endif
  222.  
  223. ; -----------------------------------------------------------------
  224. ;               Load mode
  225. ; -----------------------------------------------------------------
  226.  
  227. ; for the box use the same as above (gadid 59)
  228.  
  229. CTEXT 20 27 GuiLoad #screen 8 2 0 0001
  230. gadid 60
  231.  
  232.  
  233. XBUTTON 24 42 80 14 Load      ; load
  234. gadhelp 'Will load the selected files if they are guis'
  235. gadid 60
  236. lvuse Gui4Cli.gc 10
  237. lvmulti first
  238. while $guivar > ''
  239.     if $guivar H= G4C
  240.        guiload $guivar
  241.     endif       
  242.     lvmulti next
  243. endwhile
  244. lvdir none
  245.  
  246. XBUTTON 117 42 20 14 "P"
  247. gadhelp 'CD to Parent dir'
  248. gadid 60
  249. lvuse Gui4Cli.gc 10
  250. lvdir parent
  251. oldguidir = $$lv.dir
  252. setwintitle gui4cli.gc '$oldguidir                         '
  253.  
  254. XBUTTON 138 42 20 14 "D"
  255. gadhelp 'Show Volumes list'
  256. gadid 60
  257. lvuse Gui4Cli.gc 10
  258. lvdir disks
  259. oldguidir = ''
  260. setwintitle gui4cli.gc 'Devices'
  261.  
  262. XBUTTON 171 42 20 14 "G"
  263. gadhelp 'Shortcut to GUIs:'
  264. gadid 60
  265. lvuse Gui4Cli.gc 10
  266. lvdir #Guis:
  267. oldguidir = GUIs:
  268. setwintitle gui4cli.gc 'GUIs:'
  269.  
  270. XBUTTON 117 27 20 14 "A"  ; also shown in gui mode
  271. gadhelp 'Select all items'
  272. gadid 60
  273. lvuse Gui4Cli.gc 10
  274. lvdir all
  275.  
  276. XBUTTON 138 27 20 14 "N"
  277. gadhelp 'Unselect all items'
  278. gadid 60
  279. lvuse Gui4Cli.gc 10
  280. lvdir none
  281.  
  282.  
  283. ; -----------------------------------------------------------------
  284. ;               Favourites control
  285. ; -----------------------------------------------------------------
  286.  
  287. XBUTTON 192 27 58 14 "Fav"
  288. gadid 70
  289. gadhelp 'Switches to and from Favourites mode'
  290. lvuse gui4cli.gc 10
  291. if $mode = FAV
  292.    setgad gui4cli.gc 71 on
  293.    setgad gui4cli.gc 60/63 on
  294.    setgad gui4cli.gc 72 off
  295.    lvhelp = 'Choose guis to load'
  296.    lvmode DIR
  297.    lvdir #$oldguidir
  298.    mode = LOAD
  299. else
  300.    setgad gui4cli.gc 71 off
  301.    setgad gui4cli.gc 60/63 off
  302.    setgad gui4cli.gc 72 on
  303.    lvhelp = 'Double click on a directory, or hit FAV again to cancel'
  304.    lvmode MULTI
  305.    lvchange guis:tools/fav/G4C.fav
  306.    lvsort asc
  307.    mode = FAV
  308. endif
  309.  
  310. XBUTTON 252 27 29 14 "+"
  311. gadid 71
  312. gadhelp 'Adds the current dir the Listview is at, to your favourites'
  313. lvuse gui4cli.gc 10
  314. append guis:tools/fav/g4c.fav '\n$$lv.dir'
  315.  
  316. XBUTTON 252 42 29 14 "-"
  317. gadid 72
  318. gadhelp 'Deletes selected favourite entries'
  319. lvuse gui4cli.gc 10
  320. lvmulti first
  321. while $guivar > ''
  322.    lvdel -1
  323.    lvmulti first
  324. endwhile
  325.  
  326. XBUTTON 192 42 58 14 "Save"
  327. gadid 72
  328. gadhelp 'Save favourites to GUIs:tools/fav/G4C.fav'
  329. lvuse gui4cli.gc 10
  330. lvsave guis:tools/fav/g4c.fav
  331.  
  332.  
  333. ; -----------------------------------------------------------------
  334. ;               Gui4Cli Settings 
  335. ; -----------------------------------------------------------------
  336.  
  337.  
  338. BOX 10 90 276 41 in button
  339. gadid 80
  340.  
  341. CTEXT 20 27 'Settings:' #screen 8 2 0 0001
  342. gadid 80
  343.  
  344. XCHECKBOX 75 40 25 15 "Debug" dbg "1" "0" OFF
  345. gadid 80
  346. gadhelp 'Sets DEBUG mode On/Off'
  347. if $dbg = 1
  348.    set debug on
  349. else
  350.    set debug off
  351. endif
  352.  
  353. XCHECKBOX 75 60 25 15 Help hlp "1" "0" OFF
  354. gadid 80
  355. gadhelp 'Sets HELP On/Off'
  356. if $hlp = 1
  357.    set help on
  358. else
  359.    set help off
  360. endif
  361.  
  362. XPALETTE 160 60 106 15 
  363. gadid 81
  364. gadhelp 'Loads the GUIs:tools/palette.gc gui'
  365. guiload  guis:tools/palette.gc
  366. guiopen palette.gc
  367.  
  368. XHSLIDER 160 30 90 12 Grid grid 1 20 1 "%ld"
  369. gadid 82
  370. gadhelp 'Sets the size of the Edit Grid'
  371. set grid $grid
  372.  
  373. XHSLIDER 160 45 90 12 "Tabs" tab 0 20 8 "%ld"
  374. gadid 82
  375. gadhelp 'Sets the TAB size'
  376. set tab $tab
  377.  
  378. ; -----------------------------------------------------------------
  379. ;               Gui4Cli paths Settings 
  380. ; -----------------------------------------------------------------
  381.  
  382.  
  383. BOX 10 23 277 60 IN BUTTON
  384. gadid 83
  385.  
  386. CTEXT 20 95 'Set Paths:' #screen 8 2 0 0001
  387. gadid 83
  388.  
  389. XTEXTIN 20 110 255 15 "" path c:Ed 140
  390. gadid 84
  391. gadhelp 'Enter the new path etc here..'
  392. set $setpath $path
  393.  
  394. XCYCLER 115 95 160 14 "" setpath
  395. gadid 83
  396. gadhelp 'Cycles through the various things you can set.'
  397. CSTR 'Editor'           'editor'
  398. CSTR 'File Pattern'     'filepattern'
  399. cstr 'GuiFile Pattern'  'guipattern'
  400. cstr 'Gui Load dir'     'guiloaddir'
  401. cstr 'Default Screen'   'defscreen'
  402. CSTR 'Output'           'output'
  403. temp = '\$\$G4C.$setpath'
  404. update gui4cli.gc 84 '$temp'
  405.  
  406. ; -----------------------------------------------------------------
  407. ;               Spare area.. 
  408. ; -----------------------------------------------------------------
  409.  
  410. ; You may add stuff here.. - give them all an id of 85
  411.  
  412. BOX 10 139 276 53 IN BUTTON
  413. gadid 85
  414.  
  415. CTEXT 21 145 "Configure:" "#screen" 8 2 0 "0001"
  416. gadid 85 
  417.  
  418. XBUTTON 69 161 167 14 "Configure.."
  419. gadid 85
  420. gadhelp 'Configure External players'
  421. ifexists variable *DEF.EDITOR
  422.    else
  423.    guiload guis:tools/prefs/players
  424. endif
  425. guiload guis:tools/config.gc
  426.  
  427.  
  428. ; -----------------------------------------------------------------
  429. ;               Menus
  430. ; -----------------------------------------------------------------
  431.  
  432.  
  433. xMenu Project New.. '' N                ; new gui
  434. guiclose gui4cli.gc
  435. guiload guis:tools/guiedit.gc
  436. gosub guiedit.gc newfile
  437. if $$ret.0 = 1                          ; a gui was chosen
  438.    guiopen guiedit.gc
  439. endif
  440.  
  441. xmenu Project Gui.. '' ''               ; use the status requester
  442. status
  443.  
  444. xMenu Project BARLABEL '' ''
  445.  
  446. xMenu Project About.. '' ''
  447. ezreq 'Gui4Cli 3.2\n(c)1995-97 D.Keletsekis\ndck@prometheus.hol.gr' 'OK' ''
  448.  
  449. xMenu Project 'Quit Gui' '' ''
  450. guiquit gui4cli.gc
  451.  
  452. xMenu Project 'Quit Gui4Cli' '' ''
  453. quit
  454.  
  455. ; --------------- guis menu
  456.  
  457.  
  458. xMenu Guis "File Manager" '' ''
  459. guiload guis:dir/dir.gc
  460. guiopen dir.gc
  461. guiclose gui4cli.gc
  462.  
  463. xMenu Guis FSearch.gc '' ''
  464. guiload guis:g4c/fsearch/fsearch.gc Sys:
  465. guiclose gui4cli.gc
  466.  
  467. xMenu Guis Rep.gc '' ''
  468. guiload guis:g4c/rep.gc
  469. guiclose gui4cli.gc
  470.  
  471. xMenu Guis CedBar.gc '' ''
  472. guiload guis:g4c/ced/cedbar.gc
  473. guiclose gui4cli.gc
  474.  
  475. xMenu Guis "BARLABEL" '' ''
  476.  
  477. xMenu Guis Demo '' ''
  478. guiload guis:demo.gc
  479. guiopen demo.gc
  480. guiclose gui4cli.gc
  481.  
  482. xMenu Guis Tutorials '' ''
  483. guiload guis:docs/tutorials.gc
  484. guiopen tutorials.gc
  485. guiclose gui4cli.gc
  486.  
  487.  
  488. ; --------------- Help menu
  489.  
  490. xMenu Help "Gui4Cli Guide" '' ''
  491. run 'multiview guis:docs/gui4cli.guide'
  492.  
  493. xMenu Help "Command List" '' ''
  494. guiload guis:tools/read.gc guis:docs/PrintMe
  495.  
  496. xMenu Help "Gui4Cli ReadMe" '' ''
  497. guiload guis:tools/read.gc guis:readme.now
  498.  
  499. xMenu Help "Version Changes" '' ''
  500. guiload guis:tools/read.gc guis:docs/Changes
  501.  
  502. xMenu Help "BARLABEL" '' ''
  503.  
  504. xMenu Help "CLI Commands Guide" '' ''
  505. run 'multiview guis:docs/CLICommands.guide'
  506.  
  507. xMenu Help "Routines Guide" '' ''
  508. run 'multiview guis:docs/Routines.guide'
  509.  
  510. xMenu Help Tutorials.. '' ''
  511. guiload guis:docs/tutorials.gc
  512. guiopen tutorials.gc
  513.  
  514.